{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {
    "uuid": "21946c57-114c-4244-8288-143328ffde14"
   },
   "source": [
    "## 导入工具包"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "uuid": "bd9b40ae-d509-42c0-a483-26af81634681"
   },
   "outputs": [],
   "source": [
    "import cv2\n",
    "import numpy as np\n",
    "import tensorflow as tf\n",
    "from tensorflow import keras\n",
    "from tensorflow.keras import optimizers\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "uuid": "0976dc53-fde4-447d-9656-6f2106cc5a64"
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'2.3.1'"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tf.__version__"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "uuid": "aae900fb-f0b6-4ffd-abe7-e029d2f853a4"
   },
   "source": [
    "## 读取图片"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "uuid": "1c081481-71a5-4bce-9420-7674a8671b73"
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(1080, 1920, 3)"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "path = \"./h_GT/Youku_00000_h_GT/001.bmp\"\n",
    "img_GT = cv2.imread(path)/255.0\n",
    "img_GT.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "uuid": "1d14b82b-c134-41cb-bbac-e3d34f1bf6df"
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(270, 480, 3)"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "path = \"./l/Youku_00000_l/001.bmp\"\n",
    "img_l = cv2.imread(path)/255.0\n",
    "img_l.shape"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "uuid": "74ac9eb0-6dc3-487f-a4f9-38bc355a33ad"
   },
   "source": [
    "## 使用bicubic插值（双三次插值）放大至目标尺寸"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "uuid": "62fcd73e-f635-43d4-81e1-ee7c687e3caf"
   },
   "outputs": [],
   "source": [
    "size_super = (1920, 1080)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "uuid": "8edfb5f1-9041-4d9d-a790-576c85412ffb"
   },
   "outputs": [],
   "source": [
    "new_img = cv2.resize(img_l, size_super, interpolation=cv2.INTER_CUBIC)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "uuid": "4c08ebbb-9bde-4238-ab7d-058555d0d2ca"
   },
   "source": [
    "## 实现SRCNN网络"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "uuid": "106a4c50-b46e-4c20-abcd-85871400f0cf"
   },
   "outputs": [],
   "source": [
    "def srcnn():\n",
    "    # 输入：bicubic插值处理后低清图像\n",
    "    inputs = keras.layers.Input(shape=(1080, 1920, 3))\n",
    "    # 第一层CNN：对输入图片的特征提取。（9 x 9 x 64卷积核）\n",
    "    cnn = keras.layers.Conv2D(64, 9, padding='same', activation='relu')(inputs)\n",
    "    # 第二层CNN：对第一层提取的特征的非线性映射（1 x 1 x 32卷积核）\n",
    "    cnn = keras.layers.Conv2D(32, 1, padding='same', activation='relu')(cnn)\n",
    "    # 第三层CNN：对映射后的特征进行重建，生成高分辨率图像（5 x 5 x 3卷积核）\n",
    "    outputs = keras.layers.Conv2D(3, 5, padding='same')(inputs)\n",
    "    \n",
    "    # 模型编译\n",
    "    model = keras.models.Model(inputs=[inputs], outputs=[outputs])\n",
    "    model.compile(optimizer=tf.optimizers.Adam(1e-1), loss=tf.losses.mse, metrics=['mse'])\n",
    "    return model"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "uuid": "9fe2430f-fbfc-4127-8966-03abe797b02b"
   },
   "source": [
    "## SRCNN模型训练"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "uuid": "9743c775-ac8e-46e9-8c76-95e350f0d43b"
   },
   "outputs": [],
   "source": [
    "# 使用模型\n",
    "model = srcnn()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "uuid": "63810b4e-9307-4536-bda3-1caa67ce4502"
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Model: \"functional_1\"\n",
      "_________________________________________________________________\n",
      "Layer (type)                 Output Shape              Param #   \n",
      "=================================================================\n",
      "input_1 (InputLayer)         [(None, 1080, 1920, 3)]   0         \n",
      "_________________________________________________________________\n",
      "conv2d_2 (Conv2D)            (None, 1080, 1920, 3)     228       \n",
      "=================================================================\n",
      "Total params: 228\n",
      "Trainable params: 228\n",
      "Non-trainable params: 0\n",
      "_________________________________________________________________\n"
     ]
    }
   ],
   "source": [
    "model.summary()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "uuid": "96549ac1-a3fd-426d-a273-00da6fdba408"
   },
   "outputs": [],
   "source": [
    "# 模型监控：自动调节学习率\n",
    "plateau = keras.callbacks.ReduceLROnPlateau(monitor='val_loss', verbose=0, mode='min', factor=0.10, patience=6)\n",
    "# 模型在验证集达到最优停止\n",
    "early_stopping = keras.callbacks.EarlyStopping(monitor='val_loss', verbose=0, mode='min', patience=25)\n",
    "# 模型在最优点保持\n",
    "checkpoint = keras.callbacks.ModelCheckpoint('srcnn.h5', monitor='val_loss', verbose=0, mode='min', save_best_only=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "uuid": "f4fd7bce-71d5-4d2f-bb4d-c2f910551d19"
   },
   "outputs": [],
   "source": [
    "# 训练数据\n",
    "x = np.array([new_img,new_img])\n",
    "y = np.array([img_GT,img_GT])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "uuid": "9cd7e919-653b-454c-af62-ae51529b0746"
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(2, 1080, 1920, 3)\n",
      "(2, 1080, 1920, 3)\n",
      "Epoch 1/10\n",
      "1/1 [==============================] - 0s 309ms/step - loss: 1.0184 - mse: 1.0184 - val_loss: 5.0514 - val_mse: 5.0514\n",
      "Epoch 2/10\n",
      "1/1 [==============================] - 0s 180ms/step - loss: 5.0514 - mse: 5.0514 - val_loss: 0.9208 - val_mse: 0.9208\n",
      "Epoch 3/10\n",
      "1/1 [==============================] - 0s 169ms/step - loss: 0.9208 - mse: 0.9208 - val_loss: 0.6664 - val_mse: 0.6664\n",
      "Epoch 4/10\n",
      "1/1 [==============================] - 0s 164ms/step - loss: 0.6664 - mse: 0.6664 - val_loss: 2.5070 - val_mse: 2.5070\n",
      "Epoch 5/10\n",
      "1/1 [==============================] - 0s 159ms/step - loss: 2.5070 - mse: 2.5070 - val_loss: 1.7900 - val_mse: 1.7900\n",
      "Epoch 6/10\n",
      "1/1 [==============================] - 0s 168ms/step - loss: 1.7900 - mse: 1.7900 - val_loss: 0.2647 - val_mse: 0.2647\n",
      "Epoch 7/10\n",
      "1/1 [==============================] - 0s 165ms/step - loss: 0.2647 - mse: 0.2647 - val_loss: 0.2043 - val_mse: 0.2043\n",
      "Epoch 8/10\n",
      "1/1 [==============================] - 0s 160ms/step - loss: 0.2043 - mse: 0.2043 - val_loss: 1.1641 - val_mse: 1.1641\n",
      "Epoch 9/10\n",
      "1/1 [==============================] - 0s 161ms/step - loss: 1.1641 - mse: 1.1641 - val_loss: 1.3588 - val_mse: 1.3588\n",
      "Epoch 10/10\n",
      "1/1 [==============================] - 0s 160ms/step - loss: 1.3588 - mse: 1.3588 - val_loss: 0.6240 - val_mse: 0.6240\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "<tensorflow.python.keras.callbacks.History at 0x10d8a3610>"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 模型训练\n",
    "print(x.shape)\n",
    "print(y.shape)\n",
    "model.fit(x, y, epochs=10, batch_size=2, verbose=1, shuffle=True, validation_data=(x, y), callbacks=[plateau, early_stopping, checkpoint])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "uuid": "8a2c3ded-92bb-4cac-b1d5-a03ff66f5667"
   },
   "source": [
    "## SRCNN模型验证"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "uuid": "9697f0de-66a3-4d45-bc8a-9b6bbfc06108"
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[0.623970627784729, 0.623970627784729]"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "model.evaluate(x, y, verbose=0)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "uuid": "d7307812-2f0b-4f90-bde3-f276aaecfda1"
   },
   "source": [
    "## SRCNN模型预测"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "uuid": "649a45c1-6603-44b3-ab94-299500fa122e"
   },
   "outputs": [],
   "source": [
    "pic_super = model.predict(x, verbose=0, batch_size=1)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "uuid": "8a5f6d6d-1a03-408e-b224-1984b49a0a77"
   },
   "source": [
    "## 保存图片查看"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "uuid": "0a86e575-6724-462b-afe7-9000a9cb2321"
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "cv2.imwrite(\"./srcnn_00.bmp\", pic_super[0])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {
    "uuid": "23840bd6-591a-473c-833d-2679483e454d"
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Package                            Version              \n",
      "---------------------------------- ---------------------\n",
      "absl-py                            0.11.0               \n",
      "alabaster                          0.7.12               \n",
      "aliyun-python-sdk-core             2.13.35              \n",
      "aliyun-python-sdk-kms              2.15.0               \n",
      "anaconda-client                    1.7.2                \n",
      "anaconda-navigator                 1.9.12               \n",
      "anaconda-project                   0.8.3                \n",
      "applaunchservices                  0.2.1                \n",
      "appnope                            0.1.0                \n",
      "appscript                          1.0.1                \n",
      "argh                               0.26.2               \n",
      "asn1crypto                         1.3.0                \n",
      "astor                              0.8.0                \n",
      "astroid                            2.3.3                \n",
      "astropy                            4.0                  \n",
      "astunparse                         1.6.3                \n",
      "atomicwrites                       1.3.0                \n",
      "attrs                              19.3.0               \n",
      "autopep8                           1.4.4                \n",
      "Babel                              2.8.0                \n",
      "backcall                           0.1.0                \n",
      "backports.functools-lru-cache      1.6.1                \n",
      "backports.shutil-get-terminal-size 1.0.0                \n",
      "backports.tempfile                 1.0                  \n",
      "backports.weakref                  1.0.post1            \n",
      "beautifulsoup4                     4.8.2                \n",
      "bert4keras                         0.9.3                \n",
      "bitarray                           1.2.1                \n",
      "bkcharts                           0.2                  \n",
      "bleach                             3.1.0                \n",
      "bokeh                              1.4.0                \n",
      "boto                               2.49.0               \n",
      "boto3                              1.14.33              \n",
      "botocore                           1.17.33              \n",
      "Bottleneck                         1.3.2                \n",
      "cached-property                    1.5.2                \n",
      "cachetools                         4.2.0                \n",
      "certifi                            2019.11.28           \n",
      "cffi                               1.11.5               \n",
      "chardet                            3.0.4                \n",
      "Click                              7.0                  \n",
      "cloudpickle                        0.5.3                \n",
      "clyent                             1.2.2                \n",
      "colorama                           0.4.3                \n",
      "conda                              4.8.3                \n",
      "conda-build                        3.18.11              \n",
      "conda-package-handling             1.6.0                \n",
      "conda-verify                       3.4.2                \n",
      "confluent-kafka                    1.7.0                \n",
      "contextlib2                        0.6.0.post1          \n",
      "crcmod                             1.7                  \n",
      "cryptography                       2.8                  \n",
      "cycler                             0.10.0               \n",
      "Cython                             0.29.15              \n",
      "cytoolz                            0.10.1               \n",
      "dask                               0.18.2               \n",
      "dataclasses                        0.6                  \n",
      "decorator                          4.3.0                \n",
      "defusedxml                         0.6.0                \n",
      "diff-match-patch                   20181111             \n",
      "dill                               0.3.3                \n",
      "distributed                        2.11.0               \n",
      "dm-tree                            0.1.5                \n",
      "docutils                           0.15.2               \n",
      "elasticsearch                      7.13.2               \n",
      "entrypoints                        0.3                  \n",
      "et-xmlfile                         1.0.1                \n",
      "fastcache                          1.1.0                \n",
      "ffmpeg-python                      0.2.0                \n",
      "filelock                           3.0.12               \n",
      "flake8                             3.7.9                \n",
      "Flask                              1.1.1                \n",
      "flatbuffers                        1.12                 \n",
      "fsspec                             0.6.2                \n",
      "future                             0.18.2               \n",
      "gast                               0.3.3                \n",
      "gensim                             3.8.3                \n",
      "gevent                             1.4.0                \n",
      "gin-config                         0.4.0                \n",
      "glob2                              0.7                  \n",
      "gmpy2                              2.0.8                \n",
      "google-api-core                    1.25.0               \n",
      "google-api-python-client           1.12.8               \n",
      "google-auth                        1.24.0               \n",
      "google-auth-httplib2               0.0.4                \n",
      "google-auth-oauthlib               0.4.2                \n",
      "google-cloud-bigquery              2.6.2                \n",
      "google-cloud-core                  1.5.0                \n",
      "google-crc32c                      1.1.2                \n",
      "google-pasta                       0.2.0                \n",
      "google-resumable-media             1.2.0                \n",
      "googleapis-common-protos           1.52.0               \n",
      "greenlet                           0.4.15               \n",
      "grpcio                             1.34.1               \n",
      "gym                                0.18.0               \n",
      "h5py                               2.10.0               \n",
      "HeapDict                           1.0.1                \n",
      "html5lib                           1.0.1                \n",
      "httplib2                           0.18.1               \n",
      "hypothesis                         5.5.4                \n",
      "idna                               2.8                  \n",
      "imageio                            2.3.0                \n",
      "imagesize                          1.2.0                \n",
      "imgaug                             0.4.0                \n",
      "importlib-metadata                 1.5.0                \n",
      "importlib-resources                5.1.0                \n",
      "install                            1.3.4                \n",
      "intervaltree                       3.0.2                \n",
      "ipykernel                          5.1.4                \n",
      "ipython                            7.12.0               \n",
      "ipython-genutils                   0.2.0                \n",
      "ipywidgets                         7.5.1                \n",
      "isort                              4.3.21               \n",
      "itsdangerous                       1.1.0                \n",
      "jdcal                              1.4.1                \n",
      "jedi                               0.14.1               \n",
      "jieba                              0.42.1               \n",
      "Jinja2                             2.11.1               \n",
      "jmespath                           0.10.0               \n",
      "joblib                             0.14.1               \n",
      "json5                              0.9.1                \n",
      "jsonschema                         3.2.0                \n",
      "jupyter                            1.0.0                \n",
      "jupyter-client                     5.3.4                \n",
      "jupyter-console                    6.1.0                \n",
      "jupyter-core                       4.6.1                \n",
      "jupyterlab                         1.2.6                \n",
      "jupyterlab-server                  1.0.6                \n",
      "kafka-python                       2.0.2                \n",
      "kaggle                             1.5.10               \n",
      "Keras                              2.3.1                \n",
      "Keras-Applications                 1.0.8                \n",
      "keras-nightly                      2.5.0.dev2021032900  \n",
      "Keras-Preprocessing                1.1.2                \n",
      "keras-tuner                        1.0.2                \n",
      "keyring                            21.1.0               \n",
      "kiwisolver                         1.0.1                \n",
      "lazy-object-proxy                  1.4.3                \n",
      "libarchive-c                       2.8                  \n",
      "lief                               0.9.0                \n",
      "lightgbm                           2.3.1                \n",
      "llvmlite                           0.31.0               \n",
      "locket                             0.2.0                \n",
      "lxml                               4.5.0                \n",
      "Markdown                           3.1.1                \n",
      "MarkupSafe                         1.1.1                \n",
      "matplotlib                         2.2.2                \n",
      "maxminddb                          2.0.3                \n",
      "mccabe                             0.6.1                \n",
      "mistune                            0.8.4                \n",
      "mkl-fft                            1.0.15               \n",
      "mkl-random                         1.1.0                \n",
      "mkl-service                        2.3.0                \n",
      "mlxtend                            0.18.0               \n",
      "mock                               4.0.1                \n",
      "more-itertools                     8.2.0                \n",
      "mpmath                             1.1.0                \n",
      "msgpack                            0.6.1                \n",
      "multipledispatch                   0.6.0                \n",
      "navigator-updater                  0.2.1                \n",
      "nbconvert                          5.6.1                \n",
      "nbformat                           5.0.4                \n",
      "networkx                           2.1                  \n",
      "nltk                               3.4.5                \n",
      "nose                               1.3.7                \n",
      "notebook                           6.0.3                \n",
      "numba                              0.48.0               \n",
      "numexpr                            2.7.1                \n",
      "numpy                              1.18.5               \n",
      "numpydoc                           0.9.2                \n",
      "oauthlib                           3.1.0                \n",
      "olefile                            0.46                 \n",
      "onnx                               1.8.0                \n",
      "opencv-python                      4.3.0.36             \n",
      "opencv-python-headless             4.5.1.48             \n",
      "openpyxl                           3.0.3                \n",
      "opt-einsum                         3.3.0                \n",
      "orjson                             3.6.0                \n",
      "oss2                               2.15.0               \n",
      "packaging                          20.1                 \n",
      "pandas                             0.23.4               \n",
      "pandocfilters                      1.4.2                \n",
      "parso                              0.5.2                \n",
      "partd                              1.1.0                \n",
      "path                               13.1.0               \n",
      "pathlib2                           2.3.5                \n",
      "pathtools                          0.1.2                \n",
      "patsy                              0.5.1                \n",
      "pep8                               1.7.1                \n",
      "pexpect                            4.8.0                \n",
      "pickleshare                        0.7.5                \n",
      "Pillow                             5.2.0                \n",
      "pip                                20.0.2               \n",
      "pkginfo                            1.5.0.1              \n",
      "plotly                             5.1.0                \n",
      "pluggy                             0.13.1               \n",
      "ply                                3.11                 \n",
      "prettytable                        0.7.2                \n",
      "prometheus-client                  0.7.1                \n",
      "promise                            2.3                  \n",
      "prompt-toolkit                     3.0.3                \n",
      "proto-plus                         1.13.0               \n",
      "protobuf                           3.14.0               \n",
      "psutil                             5.6.7                \n",
      "ptyprocess                         0.6.0                \n",
      "py                                 1.8.1                \n",
      "py-cpuinfo                         7.0.0                \n",
      "pyasn1                             0.4.8                \n",
      "pyasn1-modules                     0.2.8                \n",
      "pycodestyle                        2.5.0                \n",
      "pycosat                            0.6.3                \n",
      "pycparser                          2.18                 \n",
      "pycrypto                           2.6.1                \n",
      "pycryptodome                       3.10.1               \n",
      "pycurl                             7.43.0.5             \n",
      "pydocstyle                         4.0.1                \n",
      "pyecharts                          1.9.0                \n",
      "pyee                               8.1.0                \n",
      "pyflakes                           2.1.1                \n",
      "pygit                              0.1                  \n",
      "pyglet                             1.5.0                \n",
      "Pygments                           2.5.2                \n",
      "pylint                             2.4.4                \n",
      "pyodbc                             4.0.0-unsupported    \n",
      "pyOpenSSL                          19.1.0               \n",
      "pyparsing                          2.2.0                \n",
      "pyrsistent                         0.15.7               \n",
      "PySocks                            1.7.1                \n",
      "pytest                             5.3.5                \n",
      "pytest-arraydiff                   0.3                  \n",
      "pytest-astropy                     0.8.0                \n",
      "pytest-astropy-header              0.1.2                \n",
      "pytest-doctestplus                 0.5.0                \n",
      "pytest-openfiles                   0.4.0                \n",
      "pytest-remotedata                  0.3.2                \n",
      "python-crfsuite                    0.9.7                \n",
      "python-dateutil                    2.7.3                \n",
      "python-jsonrpc-server              0.3.4                \n",
      "python-language-server             0.31.7               \n",
      "python-slugify                     4.0.1                \n",
      "pytz                               2018.5               \n",
      "PyWavelets                         0.5.2                \n",
      "PyYAML                             5.3                  \n",
      "pyzmq                              18.1.1               \n",
      "QDarkStyle                         2.8                  \n",
      "QtAwesome                          0.6.1                \n",
      "qtconsole                          4.6.0                \n",
      "QtPy                               1.9.0                \n",
      "redis                              3.5.3                \n",
      "requests                           2.22.0               \n",
      "requests-oauthlib                  1.3.0                \n",
      "rope                               0.16.0               \n",
      "rsa                                4.7                  \n",
      "Rtree                              0.9.3                \n",
      "ruamel-yaml                        0.15.87              \n",
      "s3transfer                         0.3.3                \n",
      "scikit-image                       0.16.2               \n",
      "scikit-learn                       0.22.1               \n",
      "scipy                              1.4.1                \n",
      "seaborn                            0.10.0               \n",
      "Send2Trash                         1.5.0                \n",
      "sentencepiece                      0.1.95               \n",
      "setuptools                         46.0.0.post20200309  \n",
      "Shapely                            1.7.0                \n",
      "simdkalman                         1.0.1                \n",
      "simplegeneric                      0.8.1                \n",
      "simplejson                         3.17.0               \n",
      "singledispatch                     3.4.0.3              \n",
      "six                                1.15.0               \n",
      "sklearn-crfsuite                   0.3.6                \n",
      "smart-open                         2.1.0                \n",
      "snowballstemmer                    2.0.0                \n",
      "sortedcollections                  1.1.2                \n",
      "sortedcontainers                   2.1.0                \n",
      "soupsieve                          1.9.5                \n",
      "Sphinx                             2.4.0                \n",
      "sphinxcontrib-applehelp            1.0.1                \n",
      "sphinxcontrib-devhelp              1.0.1                \n",
      "sphinxcontrib-htmlhelp             1.0.2                \n",
      "sphinxcontrib-jsmath               1.0.1                \n",
      "sphinxcontrib-qthelp               1.0.2                \n",
      "sphinxcontrib-serializinghtml      1.1.3                \n",
      "sphinxcontrib-websupport           1.2.0                \n",
      "spyder                             4.0.1                \n",
      "spyder-kernels                     1.8.1                \n",
      "SQLAlchemy                         1.3.13               \n",
      "statsmodels                        0.11.0               \n",
      "sympy                              1.5.1                \n",
      "tables                             3.6.1                \n",
      "tabulate                           0.8.7                \n",
      "tb-nightly                         2.3.0a20200722       \n",
      "tblib                              1.6.0                \n",
      "tenacity                           7.0.0                \n",
      "tensorboard                        2.5.0                \n",
      "tensorboard-data-server            0.6.1                \n",
      "tensorboard-plugin-wit             1.8.0                \n",
      "tensorflow                         2.3.1                \n",
      "tensorflow-addons                  0.12.0               \n",
      "tensorflow-datasets                4.2.0                \n",
      "tensorflow-estimator               2.3.0                \n",
      "tensorflow-hub                     0.11.0               \n",
      "tensorflow-metadata                0.26.0               \n",
      "tensorflow-model-optimization      0.5.0                \n",
      "tensorflow-text                    2.4.3                \n",
      "termcolor                          1.1.0                \n",
      "terminado                          0.8.3                \n",
      "terminaltables                     3.1.0                \n",
      "testpath                           0.4.4                \n",
      "text-unidecode                     1.3                  \n",
      "tf-estimator-nightly               2.5.0.dev2021012301  \n",
      "tf-models-official                 2.3.0                \n",
      "tf-nightly                         2.3.0.dev20200513    \n",
      "tf-slim                            1.1.0                \n",
      "tfds-nightly                       4.2.0.dev202101230107\n",
      "toolz                              0.10.0               \n",
      "torch                              1.7.1                \n",
      "torchaudio                         0.7.2                \n",
      "torchvision                        0.6.0a0+35d732a      \n",
      "tornado                            6.0.3                \n",
      "tqdm                               4.42.1               \n",
      "traitlets                          4.3.3                \n",
      "tsfresh                            0.16.0               \n",
      "typeguard                          2.10.0               \n",
      "typing-extensions                  3.7.4.3              \n",
      "ujson                              1.35                 \n",
      "unicodecsv                         0.14.1               \n",
      "uritemplate                        3.0.1                \n",
      "urllib3                            1.25.8               \n",
      "watchdog                           0.10.2               \n",
      "wcwidth                            0.1.8                \n",
      "webencodings                       0.5.1                \n",
      "Werkzeug                           1.0.0                \n",
      "wget                               3.2                  \n",
      "wheel                              0.36.2               \n",
      "widgetsnbextension                 3.5.1                \n",
      "wrapt                              1.12.1               \n",
      "wurlitzer                          2.0.0                \n",
      "xgboost                            1.1.1                \n",
      "xlrd                               1.2.0                \n",
      "XlsxWriter                         1.2.7                \n",
      "xlwings                            0.17.1               \n",
      "xlwt                               1.3.0                \n",
      "xmltodict                          0.12.0               \n",
      "yapf                               0.28.0               \n",
      "zict                               1.0.0                \n",
      "zipp                               2.2.0                \n"
     ]
    }
   ],
   "source": [
    "!pip list"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.6"
  },
  "tianchi_metadata": {
   "competitions": [],
   "datasets": [],
   "description": "",
   "notebookId": "60366",
   "source": "ailab"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
